from django.db import models

class Laptop(models.Model):
    name = models.CharField(max_length=255)  # 电脑名称
    model = models.CharField(max_length=100)  # 电脑型号
    description = models.TextField()  # 电脑描述
    price = models.DecimalField(max_digits=10, decimal_places=2)  # 价格
    stock_quantity = models.IntegerField()  # 库存数量
    image = models.ImageField(upload_to='laptops/', blank=True, null=True)  # 电脑图片

    def __str__(self):
        return self.name
# Create your models here.
